4 Set Variable textWithFootnotes to
5 Set Variable textWithoutFootnotes to
6 Set Variable _footnoteIdxParent to
7 Set Variable _footnoteIdxChild to
8 Set Variable _footnotes to
9 List »
[⌨️ Keyboard Hotkey,
📋 Cheat Sheet]
10 If [9 List] contains [Shortcut Input]
11 If [Shortcut Input ’s Name] is ⌨️ Keyboard Hotkey
12 Split Text [Repeat Item 2] by Custom »
13 Repeat[3] with Each in [12 Split Text]
14 Split Text [Repeat Item 3] by Custom »
15 Repeat[4] with Each in [14 Split Text]
16 Run Shortcut Trim Leading and Trailing Whitespace »
Workflow
: { "workflowIdentifier": "AD419317-58D1-4956-B52C-2F5F7AF0A5DF",
"workflowName": "Trim Leading and Trailing Whitespace",
"isSelf": false
}
17 Replace Text \ with \\ in [16 Shortcut Result] »
18 Text
<kbd>[17 Updated Text] </kbd>
19 End Repeat[4] with Each »
20 Combine Text [19 Repeat Results] with Custom
TextCustomSeparator
: +\u{space}
21 End Repeat[3] with Each ▵13 »
22 Combine Text [21 Repeat Results] with Custom
TextCustomSeparator
: =\u{space}
23 End If ▵11
24 If [Shortcut Input ’s Name] is 📋 Cheat Sheet
25 Text
```bash
[Repeat Item 2]
```
26 End If »
27 Set Variable textWithoutFootnotes to [26 If Result]
28 Text » 29 64 109
29 Split Text [Repeat Item 2 ’s Notes] by Custom » 30 31
TextCustomSeparator
: [28 Text]
30 Get First Item from List [29 Split Text] ➔ firstItem » 33 36 39
31 Get Last Item from List [29 Split Text] ➔ lastItem » 39 40
32 If [Shortcut Input ’s Name] is ⌨️ Keyboard Hotkey
33 Set Variable textWithFootnotes to [30 firstItem]
34 End If
35 If [Shortcut Input ’s Name] is 📋 Cheat Sheet
36 Text »
37 Set Variable textWithFootnotes to [36 Text]
38 End If
39 If [30 firstItem] is not [31 lastItem]
40 Set Variable _footnotes to [31 lastItem]
41 End If
42 Otherwise ▵10
43 Text »
44 Set Variable textWithFootnotes to [43 Text]
45 List »
[💭 Journal Prompt,
🤖\u00A0 ChatGPT Prompt,
🌍 World Cuisine,
🌱 Healthy Food]
46 If [45 List] contains [Shortcut Input]
47 Set Variable _footnotes to [Repeat Item 2 ’s Notes]
48 End If
49 List »
[👑 Life Pro Tip,
👨💻 Tech Pro Tip,
📱 Shortcuts Dev Tip,
💪 Home Exercise,
🦾 Gym Workout]
50 If [49 List] contains [Shortcut Input]
51 Split Text [Repeat Item 2 ’s Notes] by New Lines » 52 54 59
52 Count Items in [51 Split Text] »
53 If [52 Count] > 1
54 Repeat[3] with Each in [51 Split Text]
56 End Repeat[3] with Each »
57 Set Variable textWithoutFootnotes to [56 Repeat Results]
58 Otherwise
59 Set Variable _footnotes to [51 Split Text]
60 End If
61 End If ▵50
62 End If ▵42
63 If [_footnotes] has any value
64 Split Text [_footnotes] by New Lines »
TextCustomSeparator
: [28 Text]
65 Repeat[3] with Each in [64 Split Text]
66 Match Text ^[1-9+] in [Repeat Item 3] »
67 If [66 Matches] has any value
68 Match Text (?<=\s)(.*) in [Repeat Item 3] »
69 Get Match Group At Index 1 in [68 Matches]
70 Otherwise
71 Get Text from [Repeat Item 3]
72 End If »
73 Add [72 If Result] to Variable footnotes
74 Count Items in [footnotes] »
75 Add [74 Count] to Variable _footnoteIdxChild
76 End Repeat[3] with Each ▵65
77 Repeat[3] with Each in [_footnoteIdxChild]
79 End Repeat[3] with Each »
80 Combine Text [79 Repeat Results] with New Lines »
81 Replace Text \n with in [80 Combined Text] »
ReplaceTextRegularExpression
: true
82 Text »
[textWithFootnotes] [81 Updated Text]
83 Set Variable textWithFootnotes to [82 Text]
84 End If ▵63
85 If [Shortcut Input ’s Name] is ⌨️ Keyboard Hotkey
86 Text »
| [textWithoutFootnotes] | [textWithFootnotes] |
87 Add [86 Text] to Variable _section
88 End If
89 List »
[💭 Journal Prompt,
🤖\u00A0 ChatGPT Prompt,
🌍 World Cuisine,
🌱 Healthy Food]
90 If [89 List] contains [Shortcut Input]
91 Add [textWithFootnotes] to Variable _section
92 End If
93 List »
[📋 Cheat Sheet,
👑 Life Pro Tip,
👨💻 Tech Pro Tip,
📱 Shortcuts Dev Tip,
💪 Home Exercise,
🦾 Gym Workout]
94 If [93 List] contains [Shortcut Input]
95 If [textWithoutFootnotes] has any value
96 Text
[textWithFootnotes]
[textWithoutFootnotes]
97 Otherwise
98 Get Text from [textWithFootnotes]
99 End If »
100 Add [99 If Result] to Variable _section
101 End If ▵94
104 Text
[[Repeat Item] ]([Repeat Item ’s URL] )
109 Split Text [Repeat Item ’s Notes] by New Lines »
TextCustomSeparator
: [28 Text]
110 Repeat[2] with Each in [109 Split Text]
111 Match Text ^[1-9+] in [Repeat Item 2] »
112 If [111 Matches] has any value
113 Match Text (?<=\s)(.*) in [Repeat Item 2] »
114 Get Match Group At Index 1 in [113 Matches]
115 Otherwise
116 Get Text from [Repeat Item 2]
117 End If »
118 Add [117 If Result] to Variable footnotes
119 Count Items in [footnotes] »
120 Add [119 Count] to Variable _footnoteIdxParent
121 End Repeat[2] with Each ▵110
122 Repeat[2] with Each in [_footnoteIdxParent]
124 End Repeat[2] with Each »
125 Combine Text [124 Repeat Results] with New Lines »
126 Replace Text \n with in [125 Combined Text] »
ReplaceTextRegularExpression
: true
127 Text
[107 If Result] [126 Updated Text]
132 Text
## [130 If Result]
| <span style="display:inline-block; width:450px">Hotkey</span> | Note |
| --- | --- |
[_section]
134 Text
## [130 If Result]
[_section]